#include <iostream>
#define N 100

using namespace std;

void printVector(int array[], int elements){
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int row;
int column;
int matrix[N][N];
int array[N];
int elements=0;
int i,j;

cout<<"Type the number of rows: " ;
cin>>row;

cout<<"Type the number of columns: " ;
cin>>column;

cout<<"Enter matrix elements:"<<endl;
for(i=0; i<row; i++)
    for (j=0; j<column; j++){
        cout<<"["<<i<<"]["<<j<<"]= ";
        cin>>matrix[i][j];	}
for (j=column-1; j>=0; --j)
    for (i=0; i<row; i++){
        array[elements]=matrix[i][j];
        elements++;}
cout<<"Elements from right column to left column are: "<<endl;
printVector(array, elements);

return 0;
}
